package com.my.commonlibrary.fragment;

import android.graphics.Color;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.my.commonlibrary.R;
import com.my.commonlibrary.base.BaseFragment;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Author : Cooper
 * Time : 2016/9/27  11:07
 * Description : 首页具体显示内容的fragment
 */

public class H_OneFragment extends BaseFragment {
    @Bind(R.id.background_ll)
    LinearLayout backgroundLl;

    private String backgroundColor;

    @Override
    protected void initFragmentData() {
        backgroundColor = getArguments().getString("background_color");

        if(!TextUtils.isEmpty(backgroundColor)){
            backgroundLl.setBackgroundColor(Color.parseColor(backgroundColor));
        }
    }

    @Override
    protected int getFragmentLayoutRes() {
        return R.layout.frag_home_one_layout;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
